1. Field of the Invention
The present invention relates generally to an improved data processing system, and in particular, to a computer implemented method, data processing system, and computer program product for providing a generalized on-line solution to achieve transparent binary optimization using pre-existing profiling facilities and virtual memory remapping of text regions.
2. Description of the Related Art
Binary optimization refers to the optimization of a native program binary to improve the performance of a program. This optimization may be performed statically (i.e., off-line) or dynamically (i.e., while the program executes, or on-line). Existing off-line binary optimization techniques commonly used today are limited to a static process of compilation or code re-ordering which use profiles generated from instrumented executables. These off-line optimization techniques rely on instrumented binaries which collect profiling information off-line before optimization is performed. The profiling information may then be used to guide optimization decisions in the compiler or optimizer. Examples of off-line optimization include compiler-driven PDF (Profile-Directed Feedback, which is a term used by the IBM XL compilers) and FDPR (Feedback-Directed Program Re-ordering). However, off-line optimization techniques are severely limited because they must use previously collected profiling information to predict how to optimize for future workloads which may be significantly different from the past workloads used to generate the profiles.
Existing on-line binary optimization techniques commonly used today are limited to a dynamic process which uses a restricted set of interpreters or languages. Dynamic optimization provides the ability to observe and modify instructions of the executing program immediately before the instructions run. One example of on-line optimization in wide use today is a Just-In-Time (JIT) compiler for an interpreted language, such as Java® or PHP, which is a widely-used general-purpose scripting language suited for Web development and can be embedded into HTML. However, existing on-line optimizers rely on the fact that the language is interpreted (or the language that is executing is otherwise somehow externally controlled) before optimization occurs. Current research projects which focus on more general on-line binary optimization, including projects such as Dynamo, use very specific optimization techniques which rely on program interpretation, require changes to be made at load/execute time, and have difficulties dealing with synchronous exceptions/signals. None of the current on-line optimization techniques allow optimization of arbitrary already running processes.